﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.IO;

namespace IR
{
 
    
    class TermParser
    {
         
        string m_Pattern;
        Regex m_Exp;
       
        public TermParser(string pattern)
        {


            m_Pattern = pattern;
            m_Exp = new Regex(m_Pattern);

            
        }
        public MatchCollection getTerms(string InPutString)
        {
           
         
            MatchCollection MatchList = m_Exp.Matches(InPutString);
          
            //Match FirstMatch = MatchList[0];

            if (MatchList.Count > 0)
            { 
                return MatchList;
            }
            else 
                return null;

        }
            

    }
}
